package cn.xiaobai.spring.boot.listener;

import org.springframework.kafka.config.KafkaListenerEndpoint;
import org.springframework.kafka.listener.MessageListenerContainer;
import org.springframework.kafka.support.TopicPartitionOffset;
import org.springframework.kafka.support.converter.MessageConverter;

import java.util.Collection;
import java.util.regex.Pattern;

/**
 * 监听器处理器
 *
 * @Author yangdaji
 * @Date 2023/11/5
 * @PackageName cn.xiaobai.listener
 * @ClassName KafkaPlusListenerEndpoint
 */
public class KafkaPlusListenerAdapter implements KafkaListenerEndpoint {

    private BatchKafkaListener messageListener;

    public KafkaPlusListenerAdapter(BatchKafkaListener messageListener) {
        this.messageListener = messageListener;
    }

    @Override
    public String getId() {
        return null;
    }

    @Override
    public String getGroupId() {
        return null;
    }

    @Override
    public String getGroup() {
        return null;
    }

    @Override
    public Collection<String> getTopics() {
        return null;
    }

    @Override
    public TopicPartitionOffset[] getTopicPartitionsToAssign() {
        return messageListener.getTopicPartitionOffsets();
    }

    @Override
    public Pattern getTopicPattern() {
        return null;
    }

    @Override
    public String getClientIdPrefix() {
        return null;
    }

    @Override
    public Integer getConcurrency() {
        return null;
    }

    @Override
    public Boolean getAutoStartup() {
        return null;
    }

    @Override
    public void setupListenerContainer(MessageListenerContainer messageListenerContainer, MessageConverter messageConverter) {
    }

    @Override
    public boolean isSplitIterables() {
        return false;
    }


}
